package cn.tedu.appointment.work.controller;

import cn.tedu.appointment.accounts.pojo.entity.Staff;
import cn.tedu.appointment.accounts.pojo.entity.User;
import cn.tedu.appointment.accounts.pojo.vo.StaffVO;
import cn.tedu.appointment.base.response.JsonResult;
import cn.tedu.appointment.work.pojo.dto.SchedulesQuery;
import cn.tedu.appointment.work.pojo.vo.SchedulesVO;
import cn.tedu.appointment.work.service.SchedulesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@Slf4j
@Api(tags = "排班模块")
@RestController
@RequestMapping("/v1/schedules/")
public class SchedulesController {

    @Autowired
    SchedulesService schedulesService;

    @ApiOperation(value = "查询未排班员工信息")
    @GetMapping("selectNoSchedules")
    public JsonResult selectNoSchedules(){
//        log.debug("查询未排班员工信息:schedulesQuery={}",schedulesQuery);
        List<StaffVO> staffList = schedulesService.selectNoSchedules();
        return JsonResult.ok(staffList);
    }

    @ApiOperation(value = "查询排班信息")
    @GetMapping("selectSchedules")
    public JsonResult selectSchedules(SchedulesQuery schedulesQuery){
        log.debug("查询排班信息:schedulesQuery={}",schedulesQuery);
        List<SchedulesVO> schedulesVOList = schedulesService.selectSchedules(schedulesQuery);
        return JsonResult.ok(schedulesVOList);
    }


}
